{include inc/top.html}
<script src="{__DATA_URL__}js/jquery.rvf.1.2.js"></script>
<script src="{__DATA_URL__}dialog/lhgdialog.min.js?self=true&skin=discuz"></script>
<script>

    $(function(){
        $('.resize').bind('dblclick' , function(){
            if($(this).height() <= 50){
                $(this).css('height' , 120);
            }else{
                $(this).css('height' , 20);
            }
        });

        $('#form').rvf({
            submitId    : 'sbtn',
            vCallBack   : function(){
                var param = {};
                $('.input').each(function(){
                    param[$(this).attr('name')] = $(this).val();
                });
                $.ajax({
                    type     : "POST",
                    url      : $('#form').attr('action'),
                    data     : param,
                    success: function(msg){
                        var gid = parseInt($.trim(msg));
                        $('#gaid').val(gid);
                        $.dialog({
                            id      : 'vwin' ,
                            content : 'url:' + '{url:"admin@gather-debug-k-0-id-|false"}' + gid,
                            title   : '配置采集项目' ,
                            padding : 0 ,
                            drag    : false,
                            cache   : true,
                            min     : false,
                            max     : false
                        });
                    }
                });
                return false;
            }
        });

    });
</script>
<div class="index-main">
    <h1 class="h-title">{$atitle}
        <span class="sub-nav">
            <a href="{url:'admin@cat-list-ctype-%d' , $ctype}">返回列表</a>
        </span>
     </h1>
    <br/>
    <!-- <form action="{url:'admin@gather-add-id-%d-step-%d' ,$id , $step + 1}" id="form" method="post" class="form"> -->
    <form action="{url:'admin@gather-up-id-%d' ,$id}" id="form" method="post" class="form">
    <table class="table">
        <tr>
            <td class="td right"  width="80">名称:</td>
            <td class="td left" >
                <input  name="gather[id]" class="input" id="gaid" type="hidden" value="{$id}"/>
                {if $step < 1}
                <input type="text" name="gather[name]" class="req input " nullmsg="请输入采集名称" errmsg="请输入采集名称" rule="require" msgid="name_msg" value="{$ga['name']}"/>
                <span class="error-warpper"><span id="name_msg" class="error-tips"></span></span>
                {else}
                    <b>{$ga['name']}</b>
                {/if}
            </td>
        </tr>
        <tr>
            <td class="td right" >{$config['name']}:</td>
            <td class="td left" valign="top">
                {foreach $config['rule'] $sk $sv}
                        <div>{$sv['name']}&nbsp;&nbsp;&nbsp;<span class="desc" style="font-size:12px;">{$sv['desc']}</span></div>
                        <div  title="双击变大">
                            <textarea class="resize req input textarea" nullmsg="{$sv['nullmsg']}" errmsg="{$sv['errmsg']}" rule="{$sv['rule']}" msgid="err_msg_{$sv['key']}" value="{$cat['name']}" name="gather[{$sv['key']}]"></textarea>
                            <span class="error-warpper"><span id="err_msg_{$sv['key']}" class="error-tips"></span></span>
                        </div>
                {/foreach}
                {foreach $config['opts'] $sk $sv}
                    <div class="gather-block">
                        <div>
                            <input type="checkbox" name="gather[{$sv['key']}]" value="1"/> {$sv['name']}&nbsp;
                        </div>
                    </div>
                {/foreach}
            </td>
        </tr>
        <tr>
            <td class="td right"></td>
            <td class="td left"><input type="button" id="sbtn"   class="button" value="确定"/>
            </td>
        </tr>

    </table>
    <div class="clear"></div>
</div>
{include inc/bottom.html}